package com.uzai.console.vo.groupsendjob;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 对应枚举 GroupSendErrTypeEnum
 * @Auther: liuqi
 * @Date: 2021/8/10 14:58
 * @Description:
 */
@Data
@ApiModel("返回群发消息发送错误数量列表")
public class GroupSendJobSendErrInfoVo {
    @ApiModelProperty("注册来源")
    private int regChannel;
    @ApiModelProperty("未注册")
    private int unregistered;
    @ApiModelProperty("未订阅")
    private int unsubscribed;
    @ApiModelProperty("免打扰")
    private int doNotDisturb;
    @ApiModelProperty("不在通讯录")
    private int notInContacts;
    @ApiModelProperty("注册时间")
    private int regTimeErr;
    @ApiModelProperty("最后下单时间")
    private int lastOrderTimeErr;
    @ApiModelProperty("会员类型")
    private int userTypeErr;
    @ApiModelProperty("备注")
    private int remarkErr;
    @ApiModelProperty("昵称")
    private int nickErr;
    @ApiModelProperty("自定义标签")
    private int tagsErr;
    @ApiModelProperty("会员标签")
    private int userTagsErr;
    @ApiModelProperty("余额")
    private int balErr;
    @ApiModelProperty("性别")
    private int genderErr;
    @ApiModelProperty("订单不满足")
    private int orderErr;
    @ApiModelProperty("淘宝订单尾号不满足")
    private int tbLastOrderNo;
    @ApiModelProperty("黑名单")
    private int blackList;

    public synchronized void add(GroupSendJobSendErrInfoVo groupSendJobSendErrInfoVo){
        regChannel = regChannel + groupSendJobSendErrInfoVo.getRegChannel();
        unregistered = unregistered + groupSendJobSendErrInfoVo.getUnregistered();
        unsubscribed = unsubscribed + groupSendJobSendErrInfoVo.getUnsubscribed();
        doNotDisturb = doNotDisturb + groupSendJobSendErrInfoVo.getDoNotDisturb();
        notInContacts = notInContacts + groupSendJobSendErrInfoVo.getNotInContacts();
        regTimeErr = regTimeErr + groupSendJobSendErrInfoVo.getRegTimeErr();
        lastOrderTimeErr = lastOrderTimeErr + groupSendJobSendErrInfoVo.getLastOrderTimeErr();
        userTypeErr = userTypeErr + groupSendJobSendErrInfoVo.getUserTypeErr();
        remarkErr = remarkErr + groupSendJobSendErrInfoVo.getRemarkErr();
        nickErr = nickErr + groupSendJobSendErrInfoVo.getNickErr();
        tagsErr = tagsErr + groupSendJobSendErrInfoVo.getTagsErr();
        userTagsErr = userTagsErr + groupSendJobSendErrInfoVo.getUserTagsErr();
        balErr = balErr + groupSendJobSendErrInfoVo.getBalErr();
        genderErr = genderErr + groupSendJobSendErrInfoVo.getGenderErr();
        orderErr = orderErr + groupSendJobSendErrInfoVo.getOrderErr();
        tbLastOrderNo = tbLastOrderNo + groupSendJobSendErrInfoVo.getTbLastOrderNo();
        blackList = blackList + groupSendJobSendErrInfoVo.getBlackList();
    }

    public int getTotal(){
        int total =  regChannel + unregistered + unsubscribed + doNotDisturb + notInContacts + regTimeErr + lastOrderTimeErr+ userTypeErr + remarkErr + nickErr + tagsErr
                + userTagsErr + balErr + genderErr + orderErr + tbLastOrderNo + blackList;
        return total;
    }

}
